﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Interop.Excel;

namespace ExcelJsonParser
{
    abstract class JsonWorkBookBase
    {
        protected Workbook _workbook;
        protected JsonWorkSheets _jsonWorkSheets;
        public JsonWorkSheets JsonWorkSheets { get { return _jsonWorkSheets; } }
        public JsonWorkBookBase(Workbook wb)
        {
            _workbook = wb;
            Init(wb);
        }

        protected abstract void Init(Workbook wb);

        public string Name 
        { 
            get
            {
                string name = "";
                try
                {
                    name = _workbook.Name;
                }
                catch (Exception)
                {
                }
                return name; 
            } 
        }
    }
}
